<?php

	$id = request('id',false,true);
	$pid = request('pid',false,true,false,94);
	require_once $_site->get_handlepath('info');
	$title="项目展示";	

	$type = request('type',false,true,false,1);
	//$typeval=array(1=>array('title'=>'菜品展示'),2=>array('title'=>'形象案例'),3=>array('title'=>'店面展示'));
	$typeval=array(1=>array('title'=>'菜品展示'),3=>array('title'=>'店面展示'));
	$hover[$type] = "class='hover'";
	$page = request('page',false,true,false,1);
	require_once $_site->get_handlepath('pic');
	if(!$id){
		switch ($type){
		case 1:
		    $ids='87,88,89,90';
			$res = pic_fun_pic_list(array('cids'=>$ids),$page,5);

			$urlparam = '/wap/project&type='.$type;
			$pagination = "<span><font style='color:red'>$page</font>/{$res['page_count']}</span>".page_method($res['row_count'],$page,$res['page_count'],0,$urlparam,false);
		break;
		case 2:
		break;
		case 3:
			$ids = '133' ;
			$res = pic_fun_pic_list(array('cids'=>$ids),$page,5);
			$urlparam = '/wap/project&type='.$type;
			$pagination = "<span><font style='color:red'>$page</font>/{$res['page_count']}</span>".page_method($res['row_count'],$page,$res['page_count'],0,$urlparam,false);

		break;
		default:
	}
	}else{
		$content=pic_fun_get_pic_by_id($id);
	}

	$title=$typeval[$type]['title'];
?>
<?php require_once $_site->get_viewpath("wap/commom/head");?>

<body>
<div class="tittle">
      <a href="javascript:window.history.go(-1);" class="arrow_carrot-left return"></a>
	  <?php echo $title?>
	  <a href="/wap/index" class="icon_house house" style="vertical-align:middle;"></a>
</div>
<div class="nav" style="display:none;">   
            <?php
                foreach($typeval as $k=>$v){
                    echo "<a {$hover[$k]} href='/wap/project&type=$k'>{$v['title']}</a>";
                }
            ?>   
</div>
<div class="newspage">
	<div class="newspage_top" style="display:none;"><span><?php echo $typeval[$type]['title'];?></span></div>
    <div class="pic_list">
		
		<?php
			if($id){				
				echo "<img src='{$content['indexpicurl']}'>";
			}else{
			?>

				<?php
					if(is_array($res['rows'])){
						echo "<ul>";
						foreach ($res['rows'] as $v){
							$thumb = img_thumb($v['indexpicurl'],'400x267');
							echo"
								<li>
									<em><a href='/wap/project&id={$v['id']}&pid={$pid}&type={$type}'><img src='{$thumb}'></a></em>
									<p>".subs($v['title'],20)."</p>
			                        <p>".nl2br(str_replace(" ","&nbsp;",$v['description']))."</p>
								</li>
							";
						}
						echo "</ul>";
						?>
						<div class="page">
	                       <?php echo $pagination ?>
                        </div>
						<?php
					}else{
						echo"<br/><center>暂无信息！</center>";
					}
				?>			

			<?php
			}
		?>		
		
		</div>
</div>
    <?php require_once $_site->get_viewpath("wap/commom/bottom");?>
</body>
</html>
